<template>
  <div class="app-container">
    <el-form :inline="true" class="demo-form-inline">
      <el-form-item label="日期">
        <el-date-picker
          v-model="day" type="date" value-format="yyyy-MM-dd"
          placeholder="选择要统计的日期"
        />
      </el-form-item>

      <el-button :disabled="btnDisabled" type="primary" @click="genarateData()">生成图表</el-button>
    </el-form>
  </div>
</template>

<script>
  import statisticsAPi from '@/api/statistics'
  export default {
    name: 'create',
    data() {
      return{
        btnDisabled:false,
        day:''
      }
    },
    methods:{
      genarateData() {
        this.btnDisabled = true
        statisticsAPi.createStatistics(this.day).then(res => {
          this.btnDisabled = false
          this.$message.success('生成成功')
        })
      }
    }

  }
</script>

<style scoped>

</style>
